
#ifndef _UI_H
#define _UI_H

#include <common.h>
#include <disp_manager.h>
#include <input_manager.h>

//默认按钮颜色
#define BUTTON_DEFAULT_COLOR  0xff0000
#define BUTTON_PRESSED_COLOR  0x00ff00
#define BUTTON_TEXT_COLOR  	  0x000000
#define BUTTON_PERCENT_COLOR  0x0000ff

struct Button;

//定义函数指针名字
typedef int (*ONDRAW_FUNC)(struct Button *ptButton, PDispBuff ptDispBuff);
typedef	int (*ONPRESSED_FUNC)(struct Button *ptButton, PDispBuff ptDispBuff, PInputEvent ptInputEvent);


typedef struct Button {
	char *name;
	int status;//按钮状态
	Region tRegion;//框框信息
	ONDRAW_FUNC OnDraw;//画框
	ONPRESSED_FUNC OnPressed;//是按下还是松开
}Button,*PButton;
void InitButton(PButton ptButton,char *name,PRegion ptRegion,ONDRAW_FUNC OnDraw,ONPRESSED_FUNC OnPressed);

#endif

